﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace DemoMenu_01.Controllers
{
    public class MenuController : Controller
    {
        //
        // GET: /Menu/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult getMenu()
        {
            if (this.HttpContext.Cache["UserCacheMenu"] == null)
            {
                string menu = string.Empty;
                menu += "<ul id=\"qm0\" class=\"qmmc qm-horizontal-c\">";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">home</a> </li>";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">mobile</a>";
                menu += "<ul class=\"qmsub\">";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:redirectTolink('|User|RegisterCode')\">UNLOCK</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">DO SOMETHING</a></li>";
                menu += "</ul>";
                menu += "</li>";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">website</a>";
                menu += "<ul class=\"qmsub\">";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">.NET</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">PHP</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">JSP</a></li>";
                menu += "</ul>";
                menu += "</li>";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">support</a>";
                menu += "<ul class=\"qmsub\">";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">MOBILE SUPPORT</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">WEBSITE SUPPORT</a></li>";
                menu += "</ul>";
                menu += "</li>";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0);\">about</a>";
                menu += "<ul class=\"qmsub\">";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0);\">ABOUT US</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0);\">ABOUT MOBILE</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0);\">ABOUT WEBSITE</a></li>";
                menu += "</ul>";
                menu += "</li>";
                menu += "</ul>";
                this.HttpContext.Cache["UserCacheMenu"] = menu;
            }

            if (this.HttpContext.Cache["AdminCacheMenu"] == null)
            {
                string menu = string.Empty;
                menu += "<ul id=\"qm0\" class=\"qmmc qm-horizontal-c\">";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">code manager</a>";
                menu += "<ul class=\"qmsub\">";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">CODE</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">BRAND</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">CARRIER</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">MODEL</a></li>";
                menu += "</ul>";
                menu += "</li>";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">user manager</a>";
                menu += "<ul class=\"qmsub\">";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">USER</a></li>";
                menu += "<li><a class=\"qmitem-s\" href=\"javascript:void(0)\">GUEST</a></li>";
                menu += "</ul>";
                menu += "</li>";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">history payment</a></li>";
                menu += "<li><a class=\"qmitem-m qmparent\" href=\"javascript:void(0)\">support manager</a></li>";
                menu += "</ul>";
                this.HttpContext.Cache["AdminCacheMenu"] = menu;
            }
            return Content(string.Empty);
        }

        [HttpPost]
        public ActionResult ReloadMenu()
        {
            return PartialView("UC_Menu");
        }

    }
}
